// pages/set/set.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		user: '',
		a:1,
		http: getApp().globalData.map,
	},

	gb(e){
		console.log(e)
		this.setData({
			zt:e.currentTarget.dataset.id
		})
	},

	/**
	 * 生命周期函数--监听页面显示
	 */
	onShow: function() {
		wx.getSystemInfo({
		     success: e => {
						  console.log(e.statusBarHeight) //状态栏高度
		       let custom = wx.getMenuButtonBoundingClientRect();//菜单按钮
						console.log(custom)
						console.log(custom.bottom + custom.top - e.statusBarHeight)
						let a=custom.bottom + custom.top - e.statusBarHeight
						this.setData({
							gap:custom
						})
		       //计算得到定义的状态栏高度
		     }
		   })
		wx.getStorage({
			key:'uid',
			success: (res) => {
				console.log(res)
				this.setData({
					user:res.data
				})
				wx.request({
					url:getApp().globalData.http+'action=getCenter&uid='+res.data.uid,
					success: (e) => {
						console.log(e)
						this.setData({
							data:e.data.data
						})
					}
				})
			},fail: () => {
				wx.redirectTo({
					url:'../register/register'
				})
			}
		})
	},
})
